package com.test.controller;

import com.test.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.test.po.User;

import java.util.List;

/**
 * Created by Lenovo on 2019/1/10.
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/getAllUser.do")
    public String getAllUser(Model model){
        List<User> userList = userService.selectAll();
        model.addAttribute("userList", userList);
        return "userList";
    }
}
